package com.atguigu.outputformat;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.*;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;

import java.io.IOException;

/*
    自定义OutputFormat

    FileOutputFormat<K, V> :
        因为没有定义Mapper和Reducer所以k,v是InputFormat输出的K,V类型
 */
public class MyOutputFormat extends FileOutputFormat<LongWritable, Text> {

    /*
        创建一个RecordWriter的对象
     */
    @Override
    public RecordWriter<LongWritable, Text> getRecordWriter(TaskAttemptContext job) throws IOException, InterruptedException {
        return new MyRecordWriter(job);
    }
}
